//
//  UIView+NXSize.m
//  Test
//
//  Created by N-X on 2017/3/28.
//  Copyright © 2017年 Marauder. All rights reserved.
//  Category（分类）添加属性   http://www.yfnice.com/categoryfen-lei-tian-jia-shu-xing/


#import "UIView+NXSize.h"

@implementation UIView (NXSize)

- (void)setNx_x:(CGFloat)nx_x
{
    CGRect frame = self.frame;
    frame.origin.x = nx_x;
    self.frame = frame;
}

- (CGFloat)nx_x
{
    return self.frame.origin.x;
}

- (void)setNx_y:(CGFloat)nx_y
{
    CGRect frame = self.frame;
    frame.origin.y = nx_y;
    self.frame = frame;
}

- (CGFloat)nx_y{
    return self.frame.origin.y;
}

- (void)setNx_centerX:(CGFloat)nx_centerX
{
    CGPoint center = self.center;
    center.x = nx_centerX;
    self.center = center;
}

- (CGFloat)nx_centerX
{
    return self.center.x;
}

- (void)setNx_cenerY:(CGFloat)nx_cenerY
{
    CGPoint center = self.center;
    center.y = nx_cenerY;
    self.center = center;
}

- (CGFloat)nx_cenerY{
    return self.center.y;
}

- (void)setNx_width:(CGFloat)nx_width{
    CGRect frame = self.frame;
    frame.size.width = nx_width;
    self.frame = frame;
}

- (CGFloat)nx_width{
    return self.frame.size.width;
}

- (void)setNx_height:(CGFloat)nx_height{
    CGRect frame = self.frame;
    frame.size.height = nx_height;
    self.frame = frame;
}

- (CGFloat)nx_height{
    return self.frame.size.height;
}


+ (instancetype)NX_ViewFromXib
{
    return [[NSBundle mainBundle] loadNibNamed:NSStringFromClass(self) owner:nil options:nil].lastObject;
}



/*
 - (CGFloat)nx_getX{
 return  self.frame.origin.x;
 }
 */


@end
